package com.yfy.service.impl;


import com.yfy.model.entity.UserAuthority;
import com.yfy.model.mapper.UserAuthorityMapper;
import com.yfy.service.UserAuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * @Author yfy2001
 * @date 2022/11/16 9:52
 */
@Service
@Transactional
public class UserAuthorityServiceImpl implements UserAuthorityService {
    @Autowired
    private UserAuthorityMapper userAuthorityMapper;
    @Override
    public void registerBaseAuthority(Long id) {
        UserAuthority userAuthority=new UserAuthority();
        userAuthority.setCreator("System");
        userAuthority.setModifier("System");
        userAuthority.setGmtModified(new Date());
        userAuthority.setGmtCreated(new Date());
        userAuthority.setIsDeleted("N");
        userAuthority.setUserId(id);
        userAuthority.setAuthorityId(2L);
        userAuthorityMapper.addAuthority(userAuthority);
    }
}
